<pre class="code">
<span class="srcline"><span class="lineno"><a href="1,1" id="srcline1"> 1</a></span><span class="line"><span class="keyword">function</span> [<span class="var type1" id="S2T2U3">y1</span>] = costotogo(<span class="var type1" id="S3T1U6">x1</span>)</span></span>
<span class="srcline"><span class="lineno"><a href="1,2" id="srcline2"> 2</a></span><span class="line"><span class="comment">%COSTOTOGO neural network simulation function.</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,3" id="srcline3"> 3</a></span><span class="line"><span class="comment">%</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,4" id="srcline4"> 4</a></span><span class="line"><span class="comment">% Generated by Neural Network Toolbox function genFunction, 11-Jun-2014 17:34:46.</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,5" id="srcline5"> 5</a></span><span class="line"><span class="comment">% </span></span></span>
<span class="srcline"><span class="lineno"><a href="1,6" id="srcline6"> 6</a></span><span class="line"><span class="comment">% [y1] = costotogo(x1) takes these arguments:</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,7" id="srcline7"> 7</a></span><span class="line"><span class="comment">%   x = 14xQ matrix, input #1</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,8" id="srcline8"> 8</a></span><span class="line"><span class="comment">% and returns:</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,9" id="srcline9"> 9</a></span><span class="line"><span class="comment">%   y = 1xQ matrix, output #1</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,10" id="srcline10">10</a></span><span class="line"><span class="comment">% where Q is the number of samples.</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,11" id="srcline11">11</a></span><span class="line"></span></span>
<span class="srcline"><span class="lineno"><a href="1,12" id="srcline12">12</a></span><span class="line"><span class="comment">%#ok&lt;*RPMT0&gt;</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,13" id="srcline13">13</a></span><span class="line"></span></span>
<span class="srcline"><span class="lineno"><a href="1,14" id="srcline14">14</a></span><span class="line">  <span class="comment">% ===== NEURAL NETWORK CONSTANTS =====</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,15" id="srcline15">15</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,16" id="srcline16">16</a></span><span class="line">  <span class="comment">% Input 1</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,17" id="srcline17">17</a></span><span class="line">  <span class="mxinfo" id="T1:U3"><span class="var type1" id="S4T1U9">x1_step1_xoffset</span> = <span class="mxinfo" id="T1:U5">[-19.906;-9.88031;-3.1412;0.0582494635168442;-0.999999981442297;-0.999999994625933;-61.6672734555919;-20.4640483845939;-20.6576499191031;-9.38819215567605;-9.41107078716557;-1482.89654834504;-177.890385842624;-172.530246470464]</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,18" id="srcline18">18</a></span><span class="line">  <span class="mxinfo" id="T1:U6"><span class="var type1" id="S5T1U54">x1_step1_gain</span> = <span class="mxinfo" id="T1:U8">[0.0503347259274173;0.100746453646753;0.318339540954382;0.0937262730471322;1.00000001331555;1.00000001232309;0.0161954232020047;0.048674631504831;0.0489152114004245;0.16004296346025;0.160077394139578;9.53215194851665e-05;0.00852060285155151;0.00883521305980648]</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,19" id="srcline19">19</a></span><span class="line">  <span class="mxinfo" id="T2:U9"><span class="var type1" id="S6T2U86">x1_step1_ymin</span> = <span class="mxinfo" id="T2:U11">-1</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,20" id="srcline20">20</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,21" id="srcline21">21</a></span><span class="line">  <span class="comment">% Layer 1</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,22" id="srcline22">22</a></span><span class="line">  <span class="mxinfo" id="T1:U12"><span class="var type1" id="S7T1U91">b1</span> = <span class="mxinfo" id="T1:U14">[1.9314044409184716322;-1.0927069255360222222;-1.6185083943202205337;0.052235474059689993021;0.55991308266831518736;0.0039079879664824113822;-0.75947815749028257937;0.024742286863746527914;-0.41210820377094148359;0.29857072123268341146;1.6087253374469105971;-0.72004436861200449282;-0.80517686221416284731;-2.4279541881361255129]</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,23" id="srcline23">23</a></span><span class="line">  <span class="mxinfo" id="T20:U15"><span class="var type1" id="S8T20U130">IW1_1</span> = <span class="mxinfo" id="T20:U17">[-0.063257069131583687494 0.068208485774226765286 -0.29709528240968580137 0.28185232126115894458 0.039584227494056316299 -0.29323884410338912909 -0.099071373915594798665 -0.048050583221277719248 0.0092593313250284130234 -0.00024561641743427810357 0.001373737558212775791 -0.12039105452837998989 -0.0013286046582568337461 -0.002226431119220105212;3.6249581414113958289 1.0583997670749414333 0.15999276551928709456 0.0020610157347931020409 0.35653490064488213562 0.16036351239020441017 -0.16649549441311312092 3.100458203887322739 1.8333147799013325141 0.017329790147112160426 0.0098378215337864560741 -0.44286387489916262394 -0.041667131115250909124 -0.0039068307966603011208;-0.0079443492131962729907 -0.1619188343337294167 -0.017037496929640533888 0.28146714525179350463 -0.27437246900503337033 0.49612045440187496625 0.014710822971095957254 0.032743048885811976145 -0.16905128995448265306 0.0036821883812481761254 0.0044114167586565711937 0.010006804462167959505 -0.0004590583090511248421 -0.0024876872839580004872;-1.3080658012004671154 -0.50665665399345816144 -0.0028330578024241396574 -0.77481693219478575685 -0.19991205104994705377 -0.40489211606264968735 0.36835602609054546308 -1.1147003709385510106 -0.60316058169429054292 0.010569643389312469509 -0.011254369053416597712 0.86580514368742989006 -0.016644282155716016297 0.02606121955368937565;0.60560082071912357815 -1.1365488974272923706 0.099094799808767772276 0.27043605873583970167 0.19426910475684938673 -0.36867328575333757623 -0.032339836795863968755 0.55772674070816330438 -1.8400879985226199498 0.0019633083645704714482 -0.0095098255110270171059 0.17804880373842127406 -0.020389214439378331584 0.0082509253014538576354;-0.83122884715020950441 -0.76386446169944866025 0.67616681820690094362 -0.082336955795199881503 -0.10732365991776952885 -0.32813420345927546418 1.6809333636427745695 0.21975231771029615779 -1.0048411325278043815 0.01858488000463860701 0.017801851627868188477 0.2392946229010186332 -0.043579964390855922829 -0.037373817710262907665;0.14490444770004271002 0.13229895200772323616 -0.031667073130484613142 0.0043130297910641780465 -0.12439156964224556967 -0.25627354220286291397 -0.015429387384928505006 -0.033931883425634974671 0.12863042688584230833 0.00028255160490637393211 0.00077232825251118673339 -0.071734827755437213792 -0.003319180677449081341 -0.0040538451375863402554;-0.86880044969651415432 -0.31369700192208271883 -0.41117973179909883541 -0.36544741320580137467 -0.1128683263906422457 0.033724660896261499099 -0.36137615852807591921 -1.2514468024750655673 -0.76188096806633098801 0.01612350770492722643 0.019773746430652942158 -0.35519317347418311037 -0.016973355340293646426 -0.017941391549960383767;0.39084241896053106835 -1.7196858969498483027 0.011945779231072836332 -0.071027952780245540154 0.042782590617823183787 -0.493827383271690179 0.049034649884208414417 0.26639312430642669849 -2.5327335957586600834 -0.026829098743664341054 -0.019066073965026998638 0.23860144176361602897 0.042519255387552759573 0.015949221294124703296;3.6159556967020725082 -0.68294369850447012027 0.080757917983826782438 0.033661382192243134714 0.41679017216331593065 -0.20559037623982498455 -0.19159169223400546178 2.7650805584947395488 -0.95955686346635526984 -0.012220801621079378785 0.0006666016878469204366 -0.14769091477598828011 0.010236187331417052546 -0.0035179926507316813811;-0.064537725959294925393 0.065585767661644853166 -0.32827978452428513423 0.11746554542627724027 -0.0084240332352075713435 -0.28796387434587245036 0.052307387774242292133 -0.058256226967124700999 0.063748054978813625815 -0.00014635912670311527041 0.0017277221397607358654 -0.11843694390944584094 -0.00034968321855928649264 -0.0021552642738290584377;0.094153596325859525984 0.075865974658648971385 -0.023654243282460553355 0.057085267672926300053 -0.080086166879665132701 -0.14709957578363425101 -0.0077336486751792199099 -0.026481920632007802802 0.069279046500210772486 9.0822791950915814942e-06 0.00023902977527167262916 -0.037860209701408936711 -0.0016018347062648808938 -0.0020013168084900391855;-0.14256362514167081335 -0.044830399813308260959 0.014069867564420890024 0.13329897910041435538 0.094084623796948915753 0.075860881993684042834 0.014743292423716103726 0.064442057768009167185 -0.053739836659387626994 0.00019747031924765773357 0.00041833061789840145922 0.0055820034125582899259 0.0010943721914468207759 0.00099540835423030712276;-0.31408494887943672058 0.98989355355437136375 -0.55886438088591039453 -0.21870726520009747817 0.3264565525191598927 -1.0718358724628465062 0.28878614163892257771 0.086843004132728648936 0.64401964642212095047 0.012692143978236383739 0.0014126769447541081409 0.36860813718189272548 -0.027401040036820024232 -0.010417893486878623474]</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,24" id="srcline24">24</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,25" id="srcline25">25</a></span><span class="line">  <span class="comment">% Layer 2</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,26" id="srcline26">26</a></span><span class="line">  <span class="mxinfo" id="T23:U18"><span class="var type1" id="S9T23U446">b2</span> = <span class="mxinfo" id="T23:U20">[1.3579608899541952827;0.26654017891017217634;-0.72542163417192495611;-2.832299152879577786]</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,27" id="srcline27">27</a></span><span class="line">  <span class="mxinfo" id="T24:U21"><span class="var type1" id="S10T24U460">LW2_1</span> = <span class="mxinfo" id="T24:U23">[2.0362886303996785564 0.00055145216938164533845 0.26522236204867694065 0.001572651584901526298 0.011599569943619766205 0.0041829433526370529695 -1.1871087654590839477 -0.0071215576763787417913 -0.0087445549305949030888 0.0010888008974598471171 -1.6411966651301028719 2.6765263862998365241 0.72457627003177671465 0.02841518310146207843;1.6523851959220283714 -0.30775000405101082812 1.2207067730276621731 -0.70561945392233216268 -0.60076725115127027621 0.095717537044954059677 0.44621512590713585666 0.55196646705549046175 0.50908515176042135053 -0.11218994282434274767 0.15713795300867455795 -0.49969644526393697248 0.93239658684530846156 -0.48169090644926204625;-0.72329096919857316372 -2.3894192967896259461 3.5828453729295661745 -0.11337789633774378317 1.1367403707704681892 0.21371573232360618899 0.75062601234271986161 0.96959267589102071661 -1.2357783259236523321 -0.83723777326823123346 -0.058053021683626401805 -1.5168626451214310968 -0.016353830482163919657 1.1544436895135725685;-1.9805224779307746275 -5.3685783618006306384 1.2230361093964896568 2.0623801748292946989 0.58770723601784669032 -0.74801304227089693288 0.20046022031976634681 -1.6481828391955353208 -5.6019584527492263248 4.4634587443772648641 -1.4495331398823319002 1.0012356348454389821 2.8655894713209604241 -0.38267451870212071396]</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,28" id="srcline28">28</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,29" id="srcline29">29</a></span><span class="line">  <span class="comment">% Layer 3</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,30" id="srcline30">30</a></span><span class="line">  <span class="mxinfo" id="T2:U24"><span class="var type1" id="S11T2U549">b3</span> = <span class="mxinfo" id="T2:U26">0.77747122921454248079</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,31" id="srcline31">31</a></span><span class="line">  <span class="mxinfo" id="T25:U27"><span class="var type1" id="S12T25U553">LW3_2</span> = <span class="mxinfo" id="T25:U29">[5.561262892747454778 0.094742572270322469863 -0.028167106409981070708 1.7718603874685869837]</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,32" id="srcline32">32</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,33" id="srcline33">33</a></span><span class="line">  <span class="comment">% Output 1</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,34" id="srcline34">34</a></span><span class="line">  <span class="mxinfo" id="T2:U30"><span class="var type1" id="S13T2U563">y1_step1_ymin</span> = <span class="mxinfo" id="T2:U32">-1</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,35" id="srcline35">35</a></span><span class="line">  <span class="mxinfo" id="T2:U33"><span class="var type1" id="S14T2U568">y1_step1_gain</span> = <span class="mxinfo" id="T2:U35">0.0975588293155111</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,36" id="srcline36">36</a></span><span class="line">  <span class="mxinfo" id="T2:U36"><span class="var type1" id="S15T2U572">y1_step1_xoffset</span> = <span class="mxinfo" id="T2:U38">0.098549</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,37" id="srcline37">37</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,38" id="srcline38">38</a></span><span class="line">  <span class="comment">% ===== SIMULATION ========</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,39" id="srcline39">39</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,40" id="srcline40">40</a></span><span class="line">  <span class="comment">% Dimensions</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,41" id="srcline41">41</a></span><span class="line">  <span class="mxinfo" id="T2:U39"><span class="var type1" id="S16T2U576">Q</span> = <span class="mxinfo" id="T2:U41">size(<span class="var type1" id="S3T1U579">x1</span>,2)</span></span>; <span class="comment">% samples</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,42" id="srcline42">42</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,43" id="srcline43">43</a></span><span class="line">  <span class="comment">% Input 1</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,44" id="srcline44">44</a></span><span class="line">  <span class="mxinfo" id="T1:U43"><span class="var type1" id="S18T1U583">xp1</span> = <span class="mxinfo" id="T1:U45"><span class="fcn" id="F47N3:B585">mapminmax_apply</span>(<span class="var type1" id="S3T1U586">x1</span>,<span class="mxinfo" id="T1:U47"><span class="var type1" id="S5T1U587">x1_step1_gain</span></span>,<span class="mxinfo" id="T1:U49"><span class="var type1" id="S4T1U588">x1_step1_xoffset</span></span>,<span class="mxinfo" id="T2:U51"><span class="var type1" id="S6T2U589">x1_step1_ymin</span></span>)</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,45" id="srcline45">45</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,46" id="srcline46">46</a></span><span class="line">  <span class="comment">% Layer 1</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,47" id="srcline47">47</a></span><span class="line">  <span class="mxinfo" id="T1:U53"><span class="var type1" id="S20T1U592">a1</span> = <span class="mxinfo" id="T1:U55"><span class="fcn" id="F95N5:B594">tansig_apply</span>(<span class="mxinfo" id="T1:U56"><span class="mxinfo" id="T1:U57">repmat(<span class="var type1" id="S7T1U598">b1</span>,1,<span class="var type1" id="S16T2U600">Q</span>)</span> + <span class="mxinfo" id="T1:U60"><span class="mxinfo" id="T20:U61"><span class="var type1" id="S8T20U602">IW1_1</span></span>*<span class="var type1" id="S18T1U603">xp1</span></span></span>)</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,48" id="srcline48">48</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,49" id="srcline49">49</a></span><span class="line">  <span class="comment">% Layer 2</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,50" id="srcline50">50</a></span><span class="line">  <span class="mxinfo" id="T23:U64"><span class="var type1" id="S23T23U606">a2</span> = <span class="mxinfo" id="T23:U66"><span class="fcn" id="F122N5:B608">tansig_apply</span>(<span class="mxinfo" id="T23:U67"><span class="mxinfo" id="T23:U68">repmat(<span class="var type1" id="S9T23U612">b2</span>,1,<span class="var type1" id="S16T2U614">Q</span>)</span> + <span class="mxinfo" id="T23:U71"><span class="mxinfo" id="T24:U72"><span class="var type1" id="S10T24U616">LW2_1</span></span>*<span class="var type1" id="S20T1U617">a1</span></span></span>)</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,51" id="srcline51">51</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,52" id="srcline52">52</a></span><span class="line">  <span class="comment">% Layer 3</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,53" id="srcline53">53</a></span><span class="line">  <span class="mxinfo" id="T2:U75"><span class="var type1" id="S24T2U620">a3</span> = <span class="mxinfo" id="T2:U77"><span class="mxinfo" id="T2:U78">repmat(<span class="var type1" id="S11T2U624">b3</span>,1,<span class="var type1" id="S16T2U626">Q</span>)</span> + <span class="mxinfo" id="T2:U81"><span class="mxinfo" id="T25:U82"><span class="var type1" id="S12T25U628">LW3_2</span></span>*<span class="var type1" id="S23T23U629">a2</span></span></span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,54" id="srcline54">54</a></span><span class="line">  </span></span>
<span class="srcline"><span class="lineno"><a href="1,55" id="srcline55">55</a></span><span class="line">  <span class="comment">% Output 1</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,56" id="srcline56">56</a></span><span class="line">  <span class="mxinfo" id="T2:U85"><span class="var type1" id="S2T2U632">y1</span> = <span class="mxinfo" id="T2:U87"><span class="fcn" id="F157N4:B634">mapminmax_reverse</span>(<span class="var type1" id="S24T2U635">a3</span>,<span class="mxinfo" id="T2:U89"><span class="var type1" id="S14T2U636">y1_step1_gain</span></span>,<span class="mxinfo" id="T2:U91"><span class="var type1" id="S15T2U637">y1_step1_xoffset</span></span>,<span class="mxinfo" id="T2:U93"><span class="var type1" id="S13T2U638">y1_step1_ymin</span></span>)</span></span>;</span></span>
<span class="srcline"><span class="lineno"><a href="1,57" id="srcline57">57</a></span><span class="line"><span class="keyword">end</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,58" id="srcline58">58</a></span><span class="line"></span></span>
<span class="srcline"><span class="lineno"><a href="1,59" id="srcline59">59</a></span><span class="line"><span class="comment">% ===== MODULE FUNCTIONS ========</span></span></span>
<span class="srcline"><span class="lineno"><a href="1,60" id="srcline60">60</a></span><span class="line"></span></span>
<span class="srcline"><span class="lineno"><a href="1,61" id="srcline61">61</a></span><span class="line"><span class="comment">% Map Minimum and Maximum Input Processing Function</span></span></span>
</pre>
